package concepts.passbyvalue;

public class ExampleRunner {

		
	public static void trickly(Point arg1, Point arg2)
	{
		arg1.x = 100;
		arg1.y = 100;
		
		arg2 = arg1;
		
		System.out.println("-- tricky --");
		printPoint(arg1, "arg1");
		printPoint(arg2, "arg2");
		System.out.println("-- tricky --");
		
				
	}
	
	public static void main(String[] args) {
		Point pnt1 = new Point(0, 0);
		Point pnt2 = new Point(0, 0);
		
		printPoint(pnt1, "pnt1");
		printPoint(pnt2, "pnt2");
		System.out.println();
		
		trickly(pnt1, pnt2);
		System.out.println();
		printPoint(pnt1, "pnt1");
		printPoint(pnt2, "pnt2");
	}
	
	
	public static void printPoint(Point pnt, String name)
	{
		System.out.println("Point " + name + " x=" + pnt.x + "; y=" + pnt.y);
	}
}
